home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / abort.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-11  |  1.3 KB  |  53 lines

  1. /* 
  2.  * abort.c --
  3.  *
  4.  *    Source code for the "abort" library procedure.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/abort.c,v 1.4 90/09/10 17:08:38 rab Exp $ SPRITE (Berkeley)";
  18. #endif not lint
  19.  
  20. #include <sprite.h>
  21. #include <stdlib.h>
  22. #include <proc.h>
  23. #include <sig.h>
  24.  
  25. /*
  26.  *----------------------------------------------------------------------
  27.  *
  28.  * abort --
  29.  *
  30.  *    Cause abnormal termination of the process.  For now, this
  31.  *    puts the process into the debugger.
  32.  *
  33.  * Results:
  34.  *    None.
  35.  *
  36.  * Side effects:
  37.  *    The process drops into the debugger.
  38.  *
  39.  *----------------------------------------------------------------------
  40.  */
  41.  
  42. void
  43. abort()
  44. {
  45.     extern void _cleanup();
  46.  
  47.     _cleanup();
  48.     Sig_SetHoldMask(0, 0);
  49.     Sig_Send(SIG_ILL_INST, PROC_MY_PID, FALSE);
  50.     _exit(1);                /* Never return to caller, even
  51.                      * if the debugger lets us continue. */
  52. }
  53.